@echo off
# 参数
user=zhangyu
port=22
host=172.21.227.206
rootDir=/home/zhangyu/Program/ohostest
exeSrcDir=%rootDir%/code/out/sdk/mingw_x86_64/common/samples
exeDstDir=D:\WorkDir\temp\previewer
runLog=D:\WorkDir\temp\run.log

# 命令集
initCode="repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify"
syncCode="repo sync -c"
pulllfs="repo forall -c 'git lfs pull'"
prebuiltCode="bash build/prebuilts_download.sh"
buildCode="./build.sh --product-name ohos-sdk --gn-args use_musl=false --gn-args use_custom_libcxx=true --gn-args use_custom_clang=true --gn-args enable_glfw_window=true --build-target ace_for_windows"

ssh -p %port% %user%@%host% "rm -rf %rootDir%" > %runLog%
ssh -p %port% %user%@%host% "mkdir -p %rootDir%/code" >> %runLog%
ssh -p %port% %user%@%host% "cd %rootDir%/code; %initCode%" >> %runLog%
ssh -p %port% %user%@%host% "cd %rootDir%/code; %syncCode%" >> %runLog%
ssh -p %port% %user%@%host% "cd %rootDir%/code; %pulllfs%" >> %runLog%
ssh -p %port% %user%@%host% "cd %rootDir%/code; %prebuiltCode%" >> %runLog%
ssh -p %port% %user%@%host% "cd %rootDir%/code; %buildCode%" >> %runLog%
